package v1

import (
	"github.com/gogf/gf/v2/util/gmeta"
)

type CdKeyGroupQueryReq struct {
	gmeta.Meta `path:"/cdkey/group" method:"post" tags:"查询CDKEY组"`
}

type CdKeyGroupQueryRes struct {
	gmeta.Meta `mime:"application/json" example:"{code:0, message:'', data:[{id:0, name:'', extra:'', status:0, desc: '', createTime: ''},{}]}"`
}

type CdKeyGroupUpdateReq struct {
	gmeta.Meta `path:"/cdkey/update_group" method:"post" tags:"更新CDKEY"`
	Id         int    `p:"id"`
	Name       string `p:"name" v:"required"`
	Extra      string `p:"extra" v:"required"`
	Status     int    `p:"status" v:"required"`
	Desc       string `p:"desc" `
}

type CdKeyGroupUpdateRes struct {
	gmeta.Meta `mime:"application/json" example:"{code:0, message:'', data:{id:0, name:'', extra:'', status:0, desc: '', createTime: ''}"`
	Id         int    `json:"id"`
	Name       string `json:"name"`
	Extra      string `json:"extra"`
	Status     int    `json:"status"`
	Desc       string `json:"desc"`
	CreateTime string `json:"createTime"`
}

type CdKeyAddReq struct {
	gmeta.Meta  `path:"/cdkey/add" method:"post" tags:"增加Cdkey"`
	GroupId     int    `p:"groupId" v:"required"`
	Code        string `p:"code" v:"required"`
	LimitTime   string `p:"limitTime" v:"required"`
	CanUseCount int    `p:"canUseCount" v:"required"`
}

type CdKeyAddRes struct {
	gmeta.Meta  `mime:"application/json" example:"{code:0, message:'', data:{id:0, code:'', limitTime:'', canUseCount:0, usedCount:0, createTime: ''}"`
	Id          int    `json:"id"`
	Code        string `json:"code"`
	LimitTime   string `json:"limitTime"`
	CanUseCount int    `json:"canUseCount"`
	UsedCount   int    `json:"usedCount"`
	CreateTime  string `json:"createTime"`
}

type CdKeyQueryReq struct {
	gmeta.Meta `path:"/cdkey/query" method:"post" tags:"查询CdKey"`
	GroupId    int `p:"groupId" v:"required"`
	Page       int `p:"page" v:"required"`
	PageSize   int `p:"pageSize" v:"required"`
}

type CdKeyQueryRes struct {
	gmeta.Meta `mime:"application/json" example:"{code:0, message:'', data:[{id:0, code:'', limitTime:'', canUseCount:0, usedCount:0, createTime: ''},{}]"`
}

type CdKeyUseReq struct {
	gmeta.Meta `path:"/cdkey/use" method:"post" tags:"使用cdkey"`
	AccountId  int    `p:"account_id" v:"required"`
	AvatarId   int    `p:"avatarId" v:"required"`
	Code       string `p:"code" v:"required"`
}

type CdKeyUseRes struct {
	gmeta.Meta `mime:"application/json" example:"{code:0, message:'', data:'Extra礼包扩展信息'}"`
}
